package com.itqianfeng.mapper.impl;

import com.itqianfeng.mapper.OrderMapping;
import com.itqianfeng.pojo.Customer;
import com.itqianfeng.pojo.Order;

import java.sql.Date;
import java.sql.ResultSet;
import java.sql.SQLException;

public class OrderMappingImpl implements OrderMapping {
    @Override
    public Order mapping(ResultSet resultSet) throws SQLException {
        int orderId = resultSet.getInt("order_id");
        int customerId = resultSet.getInt("customer_id");
        Date orderDate = resultSet.getDate("order_date");
        int status = resultSet.getInt("status");
        String comments = resultSet.getString("comments");
        Date shippedDate = resultSet.getDate("shipped_date");
        int shippedId = resultSet.getInt("shipper_id");


        return new Order(orderId,customerId,orderDate,status,comments,shippedDate,shippedId);
    }


}
